<template>
  <view v-if="orgTenantName" class="source" @click="open">
    <text>数据来源：{{ orgTenantName }}</text>
    <text class="ali-icon">&#xe66b;</text>
  </view>
  <UniPopup ref="uniPopup" :safeArea="false">
    <view class="popup-container">
      <SourceContent :info="info" />
    </view>
  </UniPopup>
</template>

<script setup lang="ts">
  import { type MemberCardPriceResult } from '@/api/member/types';
  import { propTypes } from '@/utils/propTypes';
  import { getCurrentInstance, type PropType } from 'vue';
  import UniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
  import SourceContent from './content.vue';

  defineProps({
    orgTenantName: propTypes.string,
    info: Object as PropType<MemberCardPriceResult>,
  });

  const _this = getCurrentInstance();

  function open() {
    (_this?.refs.uniPopup as any).open('center');
  }

  
</script>

<style scoped lang="scss">
  .popup-container {
    width: 600rpx;
    padding: 30rpx;
    border-radius: 20rpx;
    background-color: #fff;
  }
  .source {
    flex: 1;
    color: #3aa5ff;
    font-size: 24rpx;
    .ali-icon {
      margin: 0 6rpx;
    }
  }
</style>
